import request from '@/utils/request'

const ADMIN_GATEWAY = "/codes";

// 查询配置列表
export function listConfig(query) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/query',
        method: 'get',
        params: query
    })
}

// 查询配置详细
export function getConfig(query) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/info',
        method: 'get',
        params: query
    })
}

// 保存配置信息
export function previewConfig(data) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/preview',
        method: 'post',
        data: data
    })
}


// 查询配置详细
export function preprintConfig(query) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/preprint',
        method: 'get',
        params: query
    })
}

// 保存配置信息
export function saveConfig(data) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/save',
        method: 'post',
        data: data
    })
}

// 保存配置信息
export function saveSetting(name, data) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/setting?name=' + name,
        method: 'post',
        data: data
    })
}

// 删除系统权限管理
export function delConfig(data) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/delete',
        method: 'post',
        data: data
    })
}


// 查询配置详细
export function downloadPdf(query) {
    return request({
        url: ADMIN_GATEWAY + '/admin/config/download',
        method: 'get',
        params: query
    })
}
